home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d13 / qptech.arc / TI532.ASC < prev    next >
Text File  |  1991-04-25  |  11KB  |  463 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8. PRODUCT  :  QUATTRO PRO                            NUMBER  :  532
  9. VERSION  :  ALL
  10.      OS  :  PC DOS
  11.    DATE  :  April 18, 1991                 PAGE  :  1/6
  12.  
  13.   TITLE  :  DELMAKER: DELIMITED OUTPUT MACRO
  14.  
  15.  
  16.  
  17.  
  18. DELMAKER is a macro that lets you create a delimited format file
  19. from a range of cells in the current spreadsheet.  The delimited
  20. formats can be Comma & Quote, Comma Only, or x delimited (where x
  21. is any label you specify).
  22.  
  23. How to enter the DELMAKER macro: 
  24.  
  25. Before typing the commands listed below, place the following
  26. block names in column A, next to the cell addresses listed.
  27.  
  28. Block names needed by DELMAKER: 
  29.  
  30.      WIDTH     B1
  31.      HEIGHT     B2
  32.      ANSWER     B3
  33.      BLOCKASK     B5..B7
  34.      DELIMITER     B8
  35.      WARNABORT     B9..B11
  36.      COUNTER1     B13
  37.      COUNTER2     B14
  38.      FILENAME     B15
  39.      CURRENTNUM  B16
  40.      CURRENTWIND B17
  41.      QUOTES?     B18
  42.      NUM_TYPE?     B19
  43.      USE_QUOTES? B20
  44.      BLANKS_AS?  B21
  45.      CELL_TYPE     B22
  46.      DO_IT     B24
  47.      WIDTHLOOP     B27
  48.      HEIGHTLOOP  B29
  49.      DONE     B31
  50.      WRITETOFILE B37
  51.      DOROW     B42
  52.      WRITECELL     B44
  53.      WRITENUMBER B53
  54.      SAVEAS     B60
  55.      VALUETYPE     B65
  56.      \D          B70
  57.      BLANKTYPE     B75
  58.      TYPECELL     B80
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74. PRODUCT  :  QUATTRO PRO                            NUMBER  :  532
  75. VERSION  :  ALL
  76.      OS  :  PC DOS
  77.    DATE  :  April 18, 1991                 PAGE  :  2/6
  78.  
  79.   TITLE  :  DELMAKER: DELIMITED OUTPUT MACRO
  80.  
  81.  
  82.  
  83.  
  84.     Note that some block names point to more than one cell.
  85.     These block names must be created using </> <Edit>
  86.     <Names> <Create>.
  87.  
  88.      After you have entered all block name in column A, choose
  89.      </> <Edit> <Names> <Labels> <Right>, type A1..A80 and press
  90.      <ENTER>.  This creates all of the block names the macro
  91.      needs.  Some of the macro commands will return ERR after you
  92.      enter them.  This is okay, since some formulas won't
  93.      evaluate properly until you run the macro.
  94.  
  95.      After you enter the block names, enter the macro commands
  96.      listed at the end of this document into a spreadsheet in the
  97.      cell addresses indicated.    Some macro commands will wrap to
  98.      the next line, which is okay.  Enter the entire command into
  99.      one cell.
  100.  
  101.      After you enter the macro, the spreadsheet must be
  102.      designated as a macro library file (</> <Tools> <Macro>
  103.      <Library> <Yes>), and saved with the file extension of .WQ1
  104.      (for example, DELMAKER.WQ1).
  105.  
  106.  
  107.      The DELMAKER macro: 
  108.  
  109.  B1:    2
  110.  B2:    3
  111.  B3:    'Y
  112.  B5:    ^Enter
  113.  B6:    ^Your
  114.  B7:    ^Range
  115.  B8:    ',
  116.  B9:    ^Invalid
  117. B10:    ^File
  118. B11:    ^(press ENTER)
  119. B16:    '    3
  120. B17:    +"["&@CURVALUE("File","Save")&"]_HERBERT"
  121. B18:    '"
  122. B19:    'Numbers
  123. B20:    (CELL_TYPE = "Value"#AND#NUM_TYPE? = "Labels")#OR#(CELL_TYPE =
  124.     "Label")#OR#(CELL_TYPE = "Blank"#AND#BLANKS_AS? = "Empty Labels")
  125. B21:    'Empty Labels
  126. B22:    'Label
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140. PRODUCT  :  QUATTRO PRO                            NUMBER  :  532
  141. VERSION  :  ALL
  142.      OS  :  PC DOS
  143.    DATE  :  April 18, 1991                 PAGE  :  3/6
  144.  
  145.   TITLE  :  DELMAKER: DELIMITED OUTPUT MACRO
  146.  
  147.  
  148.  
  149.  
  150. B24:    '{/ Name;Create}_HERBERT~
  151. B25:    '{MESSAGE BLOCKASK,100,100,0}{?}~
  152. B26:    '{LET WIDTH,0}{LET HEIGHT,0}
  153. B27:    '{IF @ISERR(@CELLINDEX("type",[]_HERBERT,WIDTH+1,0))}{LET
  154.     WIDTH,WIDTH+1}{BRANCH HEIGHTLOOP}
  155. B28:    '{LET WIDTH,WIDTH+1}{BRANCH WIDTHLOOP}
  156. B29:    '{IF @ISERR(@CELLINDEX("type",[]_HERBERT,0,HEIGHT+1}{LET
  157.     HEIGHT,HEIGHT+1}{BRANCH DONE}
  158. B30:    '{LET HEIGHT,HEIGHT+1}{BRANCH HEIGHTLOOP}
  159. B31:    '{GETLABEL "Enter the filename to print to: ",FILENAME}
  160. B32:    '{LET ANSWER,"Y"}
  161. B33:    '{IF @FILEEXISTS(FILENAME)}{GETLABEL "Overwrite Old File? (Y/N):
  162.     ",ANSWER}
  163. B34:    '{IF @LEFT(@UPPER(ANSWER),1)="Y"}{BRANCH WriteToFile}
  164. B35:    '{CLOSE FILENAME}{BRANCH DONE}
  165. B37:    '{OPEN FILENAME,W}{BEEP 2}{MESSAGE WARNABORT,0,0,0}{BRANCH DONE}
  166. B38:    '{FOR COUNTER1,0,HEIGHT-1,1,DoRow}
  167. B39:    '{CLOSE FILENAME}
  168. B40:    '{MENUBRANCH SaveAs}
  169. B42:    '{FOR counter2,0,WIDTH-1,1,WriteCell}
  170. B44:    '{TypeCell}{IF USE_QUOTES?}{WRITE QUOTES?}
  171. B45:    '{IF CELL_TYPE="Label"}{WRITE
  172.     @CELLINDEX("contents",[]_HERBERT,counter2,counter1)}
  173. B46:    '{IF BLANKS_AS?="Zeros" #AND# CELL_TYPE="Blank"}{WRITE "0"}
  174. B47:    '{IF CELL_TYPE="Value"}{CALC}{WriteNumber}
  175. B48:    '{IF USE_QUOTES?}{WRITE QUOTES?}
  176. B49:    '{IF counter2=WIDTH-1}{WRITELN ""}{BEEP 1}
  177. B50:    '{IF counter2<WIDTH-1}{WRITE DELIMITER}
  178. B52:    '{IF NUM_TYPE?="Labels"}{WriteAsLabel}{return}
  179. B53:    +"{CONTENTS CURRENTNUM,"&@CELLINDEX("address",@@(CURRENTWIND),$COUNTER2,$COUNTER1)
  180.     &","&@STRING(@CELLINDEX("width",@@(CURRENTWIND),$COUNTER2,$COUNTER1),0)&",113}"
  181. B54:    '{WRITE @trim(CURRENTNUM)}
  182. B56:    '{WRITE QUOTES?}
  183. B57:    +"{CONTENTS CURRENTNUM,"&@CELLINDEX("address",@@(CURRENTWIND),$COUNTER2,$COUNTER1)&"}"
  184. B58:    '{WRITE @trim(CURRENTNUM)}
  185. B59:    '{WRITE QUOTES?}
  186. B60:    'Comma & "" Delimited File
  187. B61:    'Save a block of data in a Comma & "" delimited format
  188. B62:    '{LET QUOTES?,""""}
  189. B63:    '{LET DELIMITER,","}{BRANCH DO_IT}
  190. B65:    'Numbers
  191. B66:    'Write the values as numbers in General Format
  192. B67:    '{LET NUM_TYPE?,"Numbers"}
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206. PRODUCT  :  QUATTRO PRO                            NUMBER  :  532
  207. VERSION  :  ALL
  208.      OS  :  PC DOS
  209.    DATE  :  April 18, 1991                 PAGE  :  4/6
  210.  
  211.   TITLE  :  DELMAKER: DELIMITED OUTPUT MACRO
  212.  
  213.  
  214.  
  215.  
  216. B68:    '{CALC}{MENUBRANCH SaveAs}
  217. B70:    '{LET QUOTES?,""""}{LET CELL_TYPE,""}{LET DELIMITER,","}
  218. B71:    '{LET NUM_TYPE?,"Numbers"}
  219. B72:    '{LET BLANKS_AS?,"Empty Labels"}
  220. B73:    '{/ Name;Create}_HERBERT~a1..a1~{MENUBRANCH SaveAs}
  221. B75:    'Empty Labels
  222. B76:    'Write the values as numbers in General Format
  223. B77:    '{LET BLANKS_AS?,"Empty Labels"}
  224. B78:    '{CALC}{MENUBRANCH SaveAs}
  225. B80:    '{IF @CELLINDEX("type",[]_HERBERT,counter2,counter1)="v"}{LET
  226.     CELL_TYPE,"Value"}
  227. B81:    '{IF @CELLINDEX("type",[]_HERBERT,counter2,counter1)="b"}{LET
  228.     CELL_TYPE,"Blank"}
  229. B82:    '{IF @CELLINDEX("type",[]_HERBERT,counter2,counter1)="l"}{LET
  230.     CELL_TYPE,"Label"}
  231. B83:    '{CALC}
  232. C60:    'Specified Delimiter Format
  233. C61:    'Save a file with Delimiters (No Quotes) in a format you choose.
  234. C62:    '{LET QUOTES?,""}{GETLABEL "Enter the Delimiter to use: ",DELIMITER}
  235. C63:    '{BRANCH DO_IT}
  236. C65:    'Labels
  237. C66:    'Write the values as labels with Formatting intact (Dates,etc.)
  238. C67:    '{LET NUM_TYPE?,"Labels"}
  239. C68:    '{CALC}{MENUBRANCH SaveAs}
  240. C75:    'Zeros
  241. C76:    'Write the values as labels with Formatting intact (Dates,etc.)
  242. C77:    '{LET BLANKS_AS?,"Zeros"}
  243. C78:    '{CALC}{MENUBRANCH SaveAs}
  244. D60:    'Only Commas
  245. D61:    'Save a block of data in a Comma Delimited Format
  246. D62:    '{LET QUOTES?,""}
  247. D63:    '{LET DELIMITER,","}{BRANCH DO_IT}
  248. D65:    'Cancel
  249. D66:    'Back out of this option
  250. D67:    '{MENUBRANCH SaveAs}
  251. D75:    'Cancel
  252. D76:    'Back out of this option
  253. D77:    '{MENUBRANCH SaveAs}
  254. E60:    +"Values Are Written As           "&NUM_TYPE?
  255. E61:    'Determine the method of storing values
  256. E62:    '{MENUBRANCH ValueType}
  257. F60:    +"Empty Cells Are Written As      "&BLANKS_AS?
  258. F61:    'Determine the method of storing empty cells
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272. PRODUCT  :  QUATTRO PRO                            NUMBER  :  532
  273. VERSION  :  ALL
  274.      OS  :  PC DOS
  275.    DATE  :  April 18, 1991                 PAGE  :  5/6
  276.  
  277.   TITLE  :  DELMAKER: DELIMITED OUTPUT MACRO
  278.  
  279.  
  280.  
  281.  
  282. F62:    '{MENUBRANCH BlankType}
  283. G60:    'Quit
  284. G61:    'Exit the macro
  285. G62:    '{/ Name;Delete}_HERBERT~
  286. G63:    '{QUIT}
  287.  
  288.  
  289. How to use DELMAKER: 
  290.  
  291.    1.  Verify that the macro library file containing the DELMAKER
  292.        macro is open.
  293.  
  294.    2.  Open the file from which you wish to extract data.  Make
  295.        sure it is the current active window.
  296.  
  297.    3.  Press:  Alt-D
  298.  
  299.    4.  The DELMAKER menu appears.  Set your options (see the
  300.        descriptions below).
  301.  
  302.    5.  Select an output format (see the descriptions below).
  303.  
  304.    6.  DELMAKER prompts you to enter a range.  Press a key to
  305.        continue, then highlight the block you want to extract.
  306.  
  307.    7.  DELMAKER prompts you to enter the name of the file to
  308.        store the extracted data.  It will warn you if you are
  309.        going to overwrite an existing file.  If the file already
  310.        exists, you can overwrite it or enter a different file
  311.        name.
  312.  
  313.    8.  When the DELMAKER menu returns, select Quit to exit the
  314.        macro or select an output format to output additional
  315.        information.
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338. PRODUCT  :  QUATTRO PRO                            NUMBER  :  532
  339. VERSION  :  ALL
  340.      OS  :  PC DOS
  341.    DATE  :  April 18, 1991                 PAGE  :  6/6
  342.  
  343.   TITLE  :  DELMAKER: DELIMITED OUTPUT MACRO
  344.  
  345.  
  346.  
  347.  
  348. The DELMAKER menu: 
  349.  
  350. The DELMAKER menu provides you with the following choices:
  351.  
  352.      ╔══════════════════════════════════════════════════╗
  353.      ║ Comma and "" Delimited Format            ║
  354.      ║ Specified Delimiter Format            ║
  355.      ║ Only Commas                    ║
  356.      ║ Values Are Written As           Numbers    ║
  357.      ║ Empty Cells Are Written As       Empty Labels ║
  358.      ║ Quit                        ║
  359.      ╚══════════════════════════════════════════════════╝
  360.  
  361. The first three options prompt you to highlight a range in the
  362. current spreadsheet and enter the name of a file to store the
  363. extracted data (Specified Delimiter Format also asks you for a
  364. delimiter).  By default, DELMAKER writes the file to the current
  365. directory.  To write to a file in another directory, enter the
  366. full path name.
  367.  
  368.      Comma & "" Delimited Format saves the file with commas
  369.      between each cell (field) in a row (record), and quotes
  370.      surrounding the contents of each field (e.g.  1,"Alpha",3).
  371.  
  372.      Specified Delimiter Format asks for a delimiter X, and then
  373.      saves the file with each cell (field) in a row (record)
  374.      delimited by the symbol you entered (e.g.    1XAlphaX3).
  375.  
  376.      Only Commas saves the file with commas between each cell
  377.      (field) in a row (record) (e.g.  1,alpha,beta,3,4).
  378.  
  379. The remaining three options provide a way to customize the
  380. delimited output.
  381.  
  382.      The Values Are Written As option lets you specify how you
  383.      want to save values.  Numbers converts values to General
  384.      display format before saving them to the extracted file.
  385.      Labels retains cell formatting (Currency, Scientific, etc.)
  386.      but stores values as labels to ensure the data translates
  387.      properly, regardless of the cell's display format.  Values
  388.      Are Written As is set to Numbers by default.
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404. PRODUCT  :  QUATTRO PRO                            NUMBER  :  532
  405. VERSION  :  ALL
  406.      OS  :  PC DOS
  407.    DATE  :  April 18, 1991                 PAGE  :  7/6
  408.  
  409.   TITLE  :  DELMAKER: DELIMITED OUTPUT MACRO
  410.  
  411.  
  412.  
  413.  
  414.     NOTE: If your data contains dates, set this option to
  415.     Labels.  Otherwise, dates are saved as a julian serial
  416.     date number, which may be meaningless to some
  417.     applications.
  418.  
  419.      The Empty Cells Are Written As option lets you specify how
  420.      DELMAKER should treat blank cells.  Empty Labels will write
  421.      blank cells as blank labels.  Zeros will write empty cells
  422.      as zero.  Empty Cells Are Written As is set to Empty Labels
  423.      by default.
  424.  
  425.      Quit exits the macro and returns you to the current
  426.      spreadsheet.
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.